package com.ruoyi.api.client.domain.vo;

import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.List;

/**
 * @author zouhuu
 * @description 题目信息视图对象
 * @date 2022/10/19 09:52:03
 */
@Data
public class QbmsQuestionInfoVo {

    @ApiModelProperty(value = "题目ID")
    private Long id;

    @ApiModelProperty(value = "题干")
    private String stem;

    @ApiModelProperty(value = "题目类型(10判断题 11单选题 12共用答案单选题)")
    private Integer choiceCategory;

    @ApiModelProperty(value = "题目题型(10 A型题 11A1型题)")
    private Integer choiceType;

    @ApiModelProperty(value = "题目等级(0-5)")
    private Integer issueGrade;

    @ApiModelProperty(value = "分类名称")
    private String categoryName;

    @ApiModelProperty(value = "学科名称")
    private String subjectName;

    @ApiModelProperty(value = "章节名称")
    private String chapterName;

    @ApiModelProperty(value = "问题列表")
    private List<Issue> issues;

    @ApiModelProperty(value = "回答标记")
    private boolean answerFlag;

    @Data
    @AllArgsConstructor
    public static class IssueOption {

        @ApiModelProperty(value = "选项")
        private String label;

        @ApiModelProperty(value = "选中状态")
        private Boolean checked;

        @ApiModelProperty(value = "勾选状态 0 默认 1正确勾选状态 2正确未勾选状态 3错误勾选状态")
        private Integer status;

        public IssueOption(String label, Boolean checked) {
            this.label = label;
            this.checked = checked;
        }
    }

    @Data
    public static class Issue {
        @ApiModelProperty(value = "问题ID")
        private Long id;

        @ApiModelProperty(value = "问题")
        private String issue;

        @ApiModelProperty(value = "问题选项")
        private List<IssueOption> issueOptions;

        @ApiModelProperty(value = "答案")
        private String answer;

        @ApiModelProperty(value = "答案解释")
        private String answerExplain;

        @ApiModelProperty(value = "我的答案")
        private String myanswer;

        public Issue(Long id, String issue,List<IssueOption> issueOptions) {
            this.id = id;
            this.issue = issue;
            this.issueOptions = issueOptions;
        }

        public Issue(Long id, String issue, List<IssueOption> issueOptions, String answer, String answerExplain, String myanswer) {
            this.id = id;
            this.issue = issue;
            this.issueOptions = issueOptions;
            this.answer = answer;
            this.answerExplain = answerExplain;
            this.myanswer = myanswer;
        }
    }

}
